<?php
namespace app\api\controller;

use think\Db;
//所有需要用户登录认证的 api控制器都要继承这个基类
class RestUserBase extends RestBase
{

    public function _initialize()
    {
        if (empty($this->user)) {
            $this->error(['code' => 10001, 'msg' => '登录已失效!']);
        }
    }

}